package com.example.demo.model.vo;

import com.example.demo.model.entity.ArtPhoto;
import com.example.demo.model.entity.Artinfo;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2024-05-20
 * Time:18:06
 */
@Data
public class ArtinfoVO {
    private int id;
    private int userId;
    private String title;
    private String content;
    private long ctime;
    private List<ArtPhoto> photos;

    public ArtinfoVO() {}
    public ArtinfoVO(Artinfo artinfo, List<ArtPhoto> artPhoto){
        this.id = artinfo.getId();
        this.userId = artinfo.getUserId();
        this.title = artinfo.getTitle();
        this.content = artinfo.getContent();
        this.ctime = artinfo.getCtime();
        this.photos = new ArrayList<>();
        for(ArtPhoto pic : artPhoto){
            this.photos.add(pic);
        }
    }
}
